﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Maps.MapControl;

namespace MyFloridaHouse.libSvOpenDistricts.MapTools
{
    


    public class MapPanControl
    {
        //todo: Convert these mapPanControl constants to config parameters
        public Location mapCenterDefault = new Location(28.0, -84.0);

        public double MapTopLimit = 24.0;
        public double MapBottomLimit = 32.0;
        public double MapRightLimit = -88.0;
        public double MapLeftLimit = -78.0;

        public bool IsViewOutsideLimits(Location TopLeft, Location BottomRight)
        {
            double mapBottom = BottomRight.Latitude;
            double mapTop = TopLeft.Latitude;
            double mapRight = BottomRight.Longitude;
            double mapLeft = TopLeft.Longitude;

            if ( (mapBottom > MapBottomLimit)  
               | (mapTop < MapTopLimit)
               | (mapRight < MapRightLimit)
               | (mapLeft > MapLeftLimit )
               )
            {
                return true;
            }
            else
            {
                return false;
            }
        }

    }
}
